<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<p:panel style="border: none;">
	<h:panelGrid columns="5" cellpadding="2" style="border: 2px;">
		<h:outputText value="Código" />
		<h:outputText value="Razao Social" />
		<h:outputText value="Nome Fantasia" />
		<h:outputText value="Telefone" />
		<h:outputText value="" />

		<p:inputText id="pcFornIdFiltro" value="#{beanFornecedor.filtro.id}"
			maxlength="4" size="7" />
		<p:inputText id="pcFornRazaoFiltro"
			value="#{beanFornecedor.filtro.razaoSocial}" size="39" />
		<p:inputText id="pcFornNomeFantFiltro"
			value="#{beanFornecedor.filtro.nomeFantasia}" size="39" />
		<p:inputText value="#{beanFornecedor.filtro.telefone}" maxlength="4" />
		<p:commandButton id="pcFornFind" value="Buscar" icon="ui-icon-search"
			action="#{beanFornecedor.find}" update="pcFornFornecedores" />
	</h:panelGrid>

	<br></br>
	<p:separator />

	<p:dataTable id="pcFornFornecedores"
		value="#{beanFornecedor.fornecedores}" var="fornecedor">
		<p:column headerText="Codigo">
			<h:outputText value="#{fornecedor.id}" />
		</p:column>
		<p:column headerText="Nome">
			<h:outputText value="#{fornecedor.nomeFantasia}" />
		</p:column>
		<p:column headerText="Razao Social">
			<h:outputText value="#{fornecedor.razaoSocial}" />
		</p:column>
		<p:column headerText="Telefone">
			<h:outputText value="#{fornecedor.telefone}" />
		</p:column>
		<p:column width="10">
			<p:commandButton id="pcFornSelectFornecedor" ajax="false"
				oncomplete="dConsultaFornecedor.hide()" icon="ui-icon-circle-check"
				title="selecionar">
				<f:setPropertyActionListener value="#{fornecedor}"
					target="#{beanCompra.compra.fornecedor}" />
			</p:commandButton>
		</p:column>
	</p:dataTable>

	<p:separator />
	<br></br>

	<h:panelGrid columns="4">
		<p:commandButton id="pcFornNovo" value="Novo" title="Criar Fornecedor"
			onclick="dManterFornecedor.show() ">
		</p:commandButton>
		<p:commandButton id="pcFornVoltar" value="Voltar"
			onclick="dConsultaFornecedor.hide()" />
	</h:panelGrid>

</p:panel>

<p:dialog header="Manter Fornecedor" widgetVar="dManterFornecedor"
	id="pcFornDManterFornecedor" resizable="false">
	<ui:include src="/fornecedor/pManterFornecedor.xhtml"></ui:include>
</p:dialog>

</html>